package com.doudou.casebook.frag_record;

import static androidx.constraintlayout.helper.widget.MotionEffect.TAG;

import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.doudou.casebook.R;
import com.doudou.casebook.db.DBManager;
import com.doudou.casebook.db.TypeBean;

import java.util.List;


public class OutComeFragment extends BaseRecordFragment {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        accountBean.setTypename("其他");
        accountBean.setsImageId(R.mipmap.ic_qita_fs);
    }
    //重写
    @Override
    public void loadDataToGV() {
        super.loadDataToGV();
        // 获取数据库中的数据
        List<TypeBean> outList = DBManager.getTypeList(0);
        typeList.addAll(outList);
        adapter.notifyDataSetChanged();
        typeIv.setImageResource(R.mipmap.ic_qita_fs);
        typeTv.setText("其他");
    }

    @Override
    public void saveAccountToDB() {
        Log.e(TAG, "saveAccountToDB: 插入" );
        accountBean.setKind(0);
        DBManager.insertItemToAccounttb(accountBean);
    }
}